﻿using System.Threading.Tasks;
using kemocard.Scripts.Common;
using kemocard.Scripts.Module.Battle;
using kemocard.Scripts.MVC;

namespace kemocard.Scripts.Card.Scripts;

public class BaseHealCard : BaseCardScript
{
    public sealed override async Task UseCard(BaseBattleCard parent)
    {
        if (Mod == null) return;
        HealStruct heal = new()
        {
            Value = parent.RealTimeValue,
            Role = parent.User.Role,
            Attribute = parent.Attribute,
            Target = parent.Target,
            User = parent.User,
        };
        CustomizeHeal(ref heal, parent);
        if (Mod != null)
        {
            await Mod.DoHeal(heal);
        }
        AfterHeal(parent);
    }

    protected virtual void CustomizeHeal(ref HealStruct heal, BaseBattleCard parent)
    {
    }

    protected virtual void AfterHeal(BaseBattleCard parent)
    {
    }
}